package com.example.demo;

import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.ServletRegistration;

@Configuration
public class ServletConfig {
    @Bean
    public ServletRegistrationBean getServlets(MyServlet my){
        ServletRegistrationBean sb=new ServletRegistrationBean(my,"/myservlet");
        return sb;
    }
}
